home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
- GIFPCX V3.6 GIF -to- ZSoft PCX Graphics File Translator
- Copyright 1988,1989 by William J. Hinkle CIS [71121,3211]
- 02 Dec 1989
-
-
- GIF and 'Graphics Interchange Format' are trademarks of
- CompuServe, Incorporated.
- an H&R Block Company
-
- === User's Guide ===
-
- The GIFPCX program was created to allow graphics files created as GIF
- (Graphics Interchange Format) files to be used in various word processors
- and desktop publishing systems that use the PCX image format. PCX images
- originated with the ZSoft Corporation's PC-Paintbrush program for the IBM-PC,
- but have become something of a de facto standard in the PC world.
-
- GIFPCX creates black-and-white PCX image from color or black-and-white GIFs.
- To do this, the program translates the GIF file into a PCX bit-mapped raster
- graphics file. In the process, GIFPCX converts the GIF image's colors into
- shades of gray, which it tries to reproduce in the black-and-white PCX image.
-
- NOTE: GIFPCX DOES NOT CREATE COLOR PCX FILES!
-
- There are zillions of GIF files available on CompuServe in the QPICS, GALLERY,
- COMART, and CORNER forums, as well in other forums, and from other sources.
- Generally they are in color, which GIFPCX changes into grayscale and then
- dithers (default) or halftones.
-
- The translator is a single file: GIFPCX.EXE. A quick and dirty example:
-
- GIFPCX yergif
-
- will convert YERGIF.GIF to YERGIF.PCX in black and white.
-
- =========
- THE CATCH
- =========
-
- Note that this program is being released by the author, and is NOT supported
- by CompuServe Inc., or ZSoft Corporation, either.
-
- It is NOT public domain!
-
- This utility program GIFPCX.EXE was written by
-
- William J. Hinkle
-
- who retains the copyright. Copy and use the program freely. Distribute
- it to whomever you want. But:
-
- === Do NOT distribute modified versions.
- === Do NOT remove the copyright notice.
- === ALWAYS distribute with the documentation.
-
- If you feel that this program has been of some utility, please register
- by sending $10.00 to:
-
- William J. Hinkle
- 420 E.Boston Mills Rd.
- Hudson, OH 44236-1111
-
-
-
- =========
- OPERATION
- =========
-
- First get a GIF image you want to integrate into your document. These are
- usually "paint" or "screen capture" images. GO PICS on CompuServe will lead
- you to a forum with all sorts of information on GIF images; GO QPICS,
- GO COMART, GO CORNER and GO GALLERY on CompuServe will lead you to collections
- of GIF images that you can download. Many on-line BBS's have GIF images
- available. You must have the GIF image in a file on disk; the file should
- have the standard .GIF file extension (i.e., fname.GIF).
-
- To create a .PCX file, type in:
-
- GIFPCX fname
- or
- GIFPCX fname.GIF
- or
- GIFPCX fname.GIF fname.PCX
-
- from the DOS command prompt. The .GIF extension is assumed if you do not
- specify one. The .PCX extension is assumed whether you specify one or not.
- The .PCX file name is made the same as the .GIF if not otherwise specified.
- Full DOS pathnames can be specified. You can specify just a directory
- (ending in \) or a drive (ending in :) instead of the second filename; the
- PCX file will use the name of the GIF file, with a PCX extension, and be
- placed on that path.
-
- The .GIF file will be translated to a black-and-white .PCX file.
- The .GIF file will not be erased. You can also specify scaling factors, but
- the defaults often work the best (see below).
-
- ==================
- WILDCARD FILENAMES
- ==================
- GIFPCX doesn't handle wildcard filenames, like *.GIF. But you can accomplish
- the same thing by using the DOS "FOR" command. See your DOS manual's section
- on Batch Commands for further info. To convert all of the GIFs in the current
- directory to PCX:
-
- FOR %f in (*.GIF) do GIFPCX %f
-
- ===============
- INTERLACED GIFS
- ===============
- Some GIF files are "interlaced" -- they are specially constructed for on-line
- viewing. GIFPCX will process this type of GIF file without complaint, but
- it has to temporarily create a special file while doing so. If you receive
- error messages about interlace processing, check that you have plenty of free
- space on your default disk.
-
-
-
- ==============
- COMPLEAT USAGE
- ==============
-
- If you invoke GIFPCX from DOS without any other parameters, it will
- display the following help message. This illustrates some of the
- other options:
-
- -----
- GIF-to-PCX Translator: V3.6 ... Copyright 1988,1989 by W.J.Hinkle
-
- Usage: GIFPCX fname1 [fname2] [option] [option] ...
- where: fname1.GIF ... GIF format input file
- fname2.PCX ... ZSoft PCX file (B&W) (default is fname1.PCX)
-
- Command Line Options:
- /v ... reverse video
- /iN ... select sub-image N (default is 1)
-
- /cN ... change contrast by N%
- /bN ... change brightness by +/-N% (BEFORE contrast %)
- /wN ... index of color to change into "white"
- /p ... print pixel histogram data (colors used)
-
- /g ... equal color weighting for grayscale GIF
- /l ... linearize colors (ignore color maps)
- /eN ... error diffused dither, expanding xN (default is 1)
- /dN ... make dither pattern block NxN
- /hN ... make halftone pattern block NxN
-
- GIFPCX is a translator from CompuServe GIF files to ZSoft PCX
- graphics files - Black and White only! - for use in printed documents.
-
- The GIF colors are converted to grayscale intensity using the weighting:
- Red 30%, Green 59%, Blue 11%. You can specify that the GIF uses only gray
- tones with the /g flag; equal color weighting will then be used.
-
- The grayscale is dithered error diffused, by default. A pattern block
- size can be used instead: select with /dN, N=1,2,4 or 8 for pattern dither
- or with /hN, N=1,2,3 or 4 for pattern halftone.
-
- The /p option will print on-screen a histogram of the colors used in the GIF,
- their RGB color components, and their brightness. You can adjust the overall
- brightness with the /bN option (-100 <= N <= +100, in percentage brightness)
- and the contrast with the /cN option (N is a percentage multiplier).
-
- Eliminate a pesky background color by specifying /wN, where N is the index
- number of that color. All the pixels in that color are turned pure white.
-
-
- (followed by copyright and shareware info)
-
-
-
- ==========
- SUB-IMAGES
- ==========
-
- If your GIF file contains multiple sub-images, you can specify which one
- to extract and translate by specifying the /iN option, where N is the sub-
- image number 1,2,3... etc. Normally, you can ignore this option; the 1st
- (or only!) image will be translated. If there are additional sub-images
- beyond the one selected, a warning is issued and they are ignored.
-
- ====================
- COLORS AND GRAYSCALE
- ====================
-
- Most GIF files are in color. GIFPCX transforms the color mapping into
- intensity of grayscale using the above mentioned weights. If you know for
- a fact that the GIF uses gray tones only, you can specify the /g option to
- use equal color weights.
-
- Once in grayscale, the image can be either dithered (the default) or
- halftoned. Normally, you don't have to even think about this, but if you want
- to tweak things, and possibly improve your results, read on...
-
- Dithering tries to average the image brightness over a small area of the
- image. The default is to use retain the size of the image in both axes,
- and use error-diffused dithering. You can vary the multiplication factor
- by specifying the /eN option with N larger than 1, where N is the size
- multiplier. In other words, the default dithering is equivalent to /e1.
- This type of dithering tends to ease problems image artifacts (those weird
- "plaid" patterns) if you later have to scale the image.
-
- You can often improve your results, at the cost of larger file sizes and
- slower processing, by specifying /e2, /e3, /e4, etc. The larger the
- number after /e, the larger the PCX file and slower the processing -- but the
- better the resolution!
-
-
-
- If you specify the /dN option (/d1, /d2, /d4, or /d8), the image size is not
- multiplied and a patterned dither is used with an NxN dither block. This can
- give smaller PCX files, but not very good visual results.
-
- Better than pattern dither is (simulated) halftoning, which replaces each GIF
- pixel with a block of on/off pixels that have a corresponding optical density.
- Halftoning will be done instead of dithering if you specify the /hN option
- (which will halftone with an NxN block). For example: /h1, /h2, /h3, or /h4.
-
- =============
- REVERSE VIDEO
- =============
-
- Normally GIFPCX flips the photometric interpretation of the GIF file colors:
- the brightest colors have the fewest pixels in the PCX file. This is because
- GIF files are generally optimized for screen viewing, but word processors will
- (eventually) put the image on paper. However, if you WANT a reverse video
- effect, use the /v option switch.
-
- ==========================
- KILLING THE COLOR MAPPING
- ==========================
-
- You can override the GIF file's color map by specifying the /l option (that's
- an "el", not a "one"). This "linearizes" the color mapping: color indices
- will be transformed directly into grayscale without worrying about how
- bright the colors really ought to be. This sometimes gives a more detailed,
- though probably less accurate, image. It may be most useful for charts
- and such.
-
- =======================
- BRIGHTNESS AND CONTRAST
- =======================
-
- The /bN option can be specified to adjust the brightness the image. The
- effect is to add N percent of maximum brightness to the image. The factor N
- can range from -100 to +100 percent. If not specified, no change in the
- brightness is made. For example: /b-25 lowers the brightness by 25%.
-
- The /cN option can be specified to adjust the contrast of the image. The
- effect is to multiply each grayscale intensity value by N%. The factor N can
- be greater or less than 100. If not specified, the contrast is left at 100%.
- For example: /c85 give 85% contrast.
-
- The contrast adjustment is applied AFTER the brightness adjustment. The
- histogram option can give you an idea of what kind of adjustments to make to
- the brightness and contrast; see below.
-
- NOTE: For many high-color images to print satisfactorily, a rule of thumb is
- to add 20 or 30 percent brightness: /b20 to /b30. Otherwise overlapping
- printer dots cause images to appear very dark -- but this varies radically
- with the word processor and printer, and even with the state of the printer
- ribbon!
-
-
-
- ===================
- WHITEOUT BACKGROUND
- ===================
-
- Simple GIFs (as found in QPICS, for example) often have a solid color
- background that will just clutter things up when printed in black-and-white.
- You can eliminate that color by specifying its color index as N in the /wN
- option. This will yield a nice clear background in the PCX image.
-
- But, how to find out the background color? Print out the histogram (see
- below) and look for a color that is used FAR more often than the rest. That
- is probably the background color. Or simply experiment.
-
- ===============
- PRINT HISTOGRAM
- ===============
-
- The /p option causes a histogram to be kept on the distribution of color
- indices in the GIF image. The RGB levels and relative brightness of each
- color, as well as the number of occurences of each value, are printed on
- the screen when the translation is complete.
-
- Here's a technique that is often helpful in improving the resulting PCX image:
-
- Translate your GIF file, using the /p option to get a histogram. You can
- re-direct the histogram printout to a file or the printer with DOS file
- redirection, e.g.:
-
- GIFPCX YERGIF /p >lpt1
-
- If you like the resulting PCX file, you're done! But if not, take a look at
- the histogram. See if the lowest brightness actually used in the picture is
- well above 0%. If so, you might want to adjust the brightness downward. See
- also if the total range of brightness is well under 100%. If so, you might
- want to adjust the contrast upward to avoid a washed-out look (especially if
- you adjust the brightness downward).
-
-
-
- ========
- EXAMPLES
- ========
-
- 1) Suppose you have a GIF file called "earthm.gif". You want to create a PCX
- file version of this image without worrying about the details. You can
- translate this to a PCX file by typing (at the DOS prompt):
-
- GIFPCX earthm
-
- and you will see something like:
- -----
- GIF-to-PCX Translator: V3.6 ... Copyright 1988, 1989 by W.J.Hinkle
-
- From GIF 640x350x16 file: earthm.gif
- to PCX 640x350 file: earthm.pcx
- dithered error diffused with +0% brightness, 100% contrast.
- -----
- Note that both the GIF image resolution and color range are shown:
- GIF Width x Height x # of Colors
-
- Also shown is the final PCX image resolution:
- PCX Width x Height
-
-
-
-
- 2) Suppose you have a GIF file called "yikes.gif". You can translate
- this to a PCX file by typing (at the DOS prompt):
-
- GIFPCX yikes /h4
-
- and you will see something like:
- -----
- GIF-to-PCX Translator: V3.6 ... Copyright 1988, 1989 by W.J.Hinkle
-
- From GIF 156x131x16 file: yikes.gif
- to PCX 624x524 file: yikes.pcx
- halftoned into a 4x4 pixel matrix with +0% brightness, 100% contrast.
- -----
-
- 3) Suppose you have a black and white clipart GIF file called "barn.gif".
- You can translate this to a PCX file by typing (at the DOS prompt):
-
- GIFPCX barn
-
- and you will see something like:
- -----
- GIF-to-PCX Translator: V3.6 ... Copyright 1988, 1989 by W.J.Hinkle
-
- From GIF 280x280x2 file: barn.gif
- to PCX 280x280 file: barn.pcx
- -----
-
- Note that no dithering or halftoning information is shown for 2-color (aka
- monochrome) GIFs -- they are simply changed into black and white PCX files
- without further processing. This is true for ANY 2-color GIF, even if it
- isn't black and white (say, blue and white).
-
-
-
- ===========
- ERROR CODES
- ===========
-
- If an error occurs within GIFPCX, it will print an error message and
- terminate the program. You may be left with a partial PCX file on-disk,
- so just delete that (or it will be overwritten if you try again). The
- errors messages are in the form:
-
- Error #NNNN: Message
-
- where the message is pretty generic, and indicates the name of the offending
- file, if any. The error numbers are mostly "standard" DOS errors, and a few
- are peculiar to GIFPCX.
-
- DOS
- Error Meaning
- ----- -------
- 0 Cause of error unknown
- 1 Invalid DOS function
- 2 File not found
- 3 Path not found
- 4 Too many files opened
- 5 Access denied
- 6 Invalid handle
- 7 Memory control blocks destroyed
- 8 Insufficient memory
- 9 Invalid memory block address
- 10 Invalid environment
- 11 Invalid format
- 12 Invalid access code
- 13 Invalid data
- 15 Invalid drive code
- 16 Can't remove current directory
- 17 Not same device
- 18 No more files
- 19 Can't write on protected device
- 20 Unknown unit
- 21 Drive not ready
- 22 Unknown command
- 23 Data error
- 24 Bad request structure length
- 25 Seek error
- 26 Unknown media type
- 27 Sector not found
- 28 Printer paper alarm
- 29 Write fault
- 30 Read fault
- 31 General failure
- 32 Sharing violation
- 33 Lock violation
- 34 Invalid disk change,
- 35 FCB unavailable
- 36 Sharing buffer overflow
-
-
-
- DOS
- Error Meaning
- ----- -------
- 50 Network request not supported
- 51 Remote computer not listening
- 52 Duplicate name on network
- 53 Network name not found
- 54 Network busy
- 55 Network device no longer exists
- 56 Net BIOS command limit exceeded
- 57 Network adaptor hardware error
- 58 Incorrect response from network
- 59 Unexpected network error
- 60 Incompatible remote adaptor
- 61 Print queue full
- 62 Not enough space for print file
- 63 Print file was deleted
- 64 Network name was deleted
- 65 Access denied
- 66 Incorrect network device type
- 67 Network name not found
- 68 Network name limit exceeded
- 69 Net BIOS session limit exceeded
- 70 Temporarily paused
- 71 Network request not accepted
- 72 Print or disk redirection is paused
- 80 File exists
- 82 Cannot make directory entry
- 83 Fail on INT 24
- 84 Too many redirections
- 85 Duplicate redirection
- 86 Invalid password
- 87 Invalid parameter
- 88 Network device fault
-
- GIFPCX
- Error Meaning
- ------ -------
- 8100 Unknown command line switch
- 8101 Can't use enough memory for operation (image too large?)
- 8102 Disk is full
- 8103 Input file shorter than expected
- 8104 Sub-image does not exist
- 8105 Ctrl-Break (Ctrl-C) pressed
-
- 8200 GIF input file header not as expected
- 8201 GIF input file format not as expected
- 8202 Unknown GIF format ID
- 8203 Error decoding GIF image
-
-
-
- ======
- HELP!?
- ======
-
- Should you have any difficulties using this program, you can contact me
- (Bill Hinkle) through CompuServe EMAIL to [71121,3211], in the PICS forum,
- or at the address on the first page of this document. General feedback is
- welcome, especially on better methods of color reduction, grayscale halftoning
- and dithering, and problem GIF files.
-
- Thanks to Bob Cancilla [76077,354] for his prototype testing & help on
- the original GIF2BIT for Lotus Manuscript.
- Thanks to Jeff Lewis [72717,1033] for ideas on halftoning and dithering.
- Thanks to Kyle Powell [76044,2215] for his public domain LZW decoder 85GIF.
- Thanks to Tom Pfau for his public domain LZW decoder.
- Thanks to Floyd & Steinberg for the error diffused dither algorithm.
- Thanks to Larry Brennan and Millard Brown for their comments and suggestions.
-
- Thanks to the many CIS beta testers and folks who reported problems.
-
- =============
- REVISION INFO
- =============
-
- * Version number Date Explanation *
- * -------------- ------ -------------------------- *
- * 3.4 07 Nov 89 derived from GIF2BIT and GIF2WPG *
- * 3.5 02 Dec 89 improved due to some good advice *
- * 3.6 17 Dec 89 tweaked for B&W GIF Clipart *
-
- ----------------end-of-author's-documentation---------------
-
- Software Library Information:
-
- This disk copy provided as a service of
-
- The Public (Software) Library
-
- We are not the authors of this program, nor are we associated
- with the author in any way other than as a distributor of the
- program in accordance with the author's terms of distribution.
-
- Please direct shareware payments and specific questions about
- this program to the author of the program, whose name appears
- elsewhere in this documentation. If you have trouble getting
- in touch with the author, we will do whatever we can to help
- you with your questions. All programs have been tested and do
- run. To report problems, please use the form that is in the
- file PROBLEM.DOC on many of our disks or in other written for-
- mat with screen printouts, if possible. The P(s)L cannot de-
- bug programs over the telephone.
-
- Disks in the P(s)L are updated monthly, so if you did not get
- this disk directly from the P(s)L, you should be aware that
- the files in this set may no longer be the current versions.
-
- For a copy of the latest monthly software library newsletter
- and a list of the 2,000+ disks in the library, call or write
-
- The Public (Software) Library
- P.O.Box 35705
- Houston, TX 77235-5705
- (713) 524-6394
-